<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业11</title>
</head>
<body>
<script>
    var randomNum = Math.floor(Math.random() * 100 + 1);
    console.log(randomNum);
    var str = "";
    while (true) {
        str = parseInt(randomNum % 2) + str;
        randomNum =parseInt(randomNum/ 2);
        if (randomNum == 0) {
            break;
        }
    }
    console.log(str);
</script>
</body>
</html>